<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文字处理工具</title>
<link type="text/css" href="../css/themes/green/jquery.ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="../js/external/jquery.bgiframe-2.1.1.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.tabs.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.mouse.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../js/jquery-ui/jquery.ui.dialog.js"></script>
	<link type="text/css" href="../css/demos.css" rel="stylesheet" />

  <script src="../js/joyWindow.js"  type="text/javascript" language="javascript"></script>
  <script language="javascript">

  function mask()
  {
	  jQ("#dialog-modal").dialog('open');
	  $('a.ui-dialog-titlebar-close').hide();
  }

  function unmask()
  {
	  $('a.ui-dialog-titlebar-close').show();
	  jQ("#dialog-modal").dialog('close');
  }
  
   function handleSuccess(text)
		 {
	   		unmask();
			 try{
			   var jsonObj=eval(text);
			   	if(jsonObj.state==true)
				   	{
				   		if(jsonObj.message=='1')
				   		{
				   			jQ("#beanNames").val(jsonObj.jsonStr);
					   	}else jQ("#dataBaseNames").val(jsonObj.jsonStr);
				   	}
			   	else
			   	{
			   		jQ("#dialog-message").html(jsonObj.message);
					jQ("#dialog-message").dialog("open");
				}
			   }catch(e)
			   {
				   jQ("#dialog-message").html(text);
				   jQ("#dialog-message").dialog("open");
			   }
		 }
	 
   function handleFailure(text)
	 {
		 unmask();
		 if(window.confirm("请求出错!是否查看返回信息?"))
			 	if(text.responseText==undefined||text.responseText==''||text.responseText.trim()=='')
			 		jQ("#dialog-message").html("多实例模式的源服务器已停止，无法执行操作！");
				 	else
			 		jQ("#dialog-message").html(text.responseText);
			 			
	   		 jQ("#dialog-message").dialog("open");
		 	
	 }


  var jQCallBack={"success":handleSuccess,"failure":handleFailure}; 



  
  function dbAndBeanConvert(way)
	{
	 	 var url='dbAndBeanConvert.do';
	 	 var datas='';
		 if(way==1)
		 {
			 datas="dataBaseNames="+jQ("#dataBaseNames").val(); 
	     }
		 else if(way==2)
		 {
			 datas="beanNames="+jQ("#beanNames").val(); 
		 }
		 datas+='&way='+way;
		 mask();
		 jWindow.ajaxPostJSBack(url,jQCallBack,datas);
	}




	jQ(document).ready(function()
			{
			
			jQ("#tabs").tabs();
			jQ( "#dialog-modal" ).dialog({ autoOpen: false,modal: true,resizable: false,disabled: true });
			jQ("#dialog-message").dialog({autoOpen: false,modal: false, resizable: false});
		 });

	window.onload=function()
	{
		var config=new windowConfig();
		config.alpha=255;
		jWindow.initWindow(config);
	}




	
  </script>
</head>
<body>
<div class="demo">
  <div id="tabs">	
  <ul>
  		<li><a href="#tabs-1">数据库与实体bean字段名互转</a></li>
  		
  		<li><a href="#tabs-3">帮助</a></li>
  </ul>
  
  <div id="tabs-1">
  <FORM id="form1" METHOD=POST ACTION="" onsubmit="return false;">
		<table>
		<tr><td>数据库字段名:</td>
		<td><textarea id="dataBaseNames" NAME="dataBaseNames" cols="40" rows="4">APPLY_AMOUNT</textarea>
		</td>
		<td>
		<input type="button" id="bt_toBeanName"  value="转换"  onclick="dbAndBeanConvert(1);"/>
		</td>
		</tr>

		<tr><td>
			实体bean字段名:
		</td>
		<td>
		<textarea id="beanNames" NAME="beanNames"  cols="40" rows="4">ApplyAmount</textarea>
		</td>
		<td><input type="button" id="bt_toDBName" value="转换" onclick="dbAndBeanConvert(2);"/></td>
		</tr>
<tr	colspan="2">		<td><input type="button" id="closeW" value=关闭"" onclick="window.close();"/></td><td>
	  </table>
	  </FORM>
	  </div>
	 
	  
	   <div id="tabs-3">
	    <p>
	    	1.数据库与实体bean字段名互转工具可实现属性名的相互转换
	    </p>
	   </div>
	</div>  <!-- end of tab -->
	
	
	</div>
	


	<div id="dialog-modal" title="处理中">
	<center><img src="../img/loading2.gif" alt="loading"></img></center>
	</div>
	
	<div id="dialog-message" title="提示信息">
	</div>
</body>
</html>
